<?php
// Version: PhpInfo 1.0

function template_info()
{
	global $txt;

	echo '
	<table width="100%" border="0" cellspacing="0" cellpadding="3" align="center">
		<tr>
			<td>', theme_linktree(), '</td>
		</tr>
	</table>
	<table width="100%" border="0" cellspacing="0" cellpadding="4" align="center" class="tborder">
		<tr class="titlebg">
			<td>', $txt['phpInfo_title'], '</td>
		</tr>
		<tr>
			<td>';
	echo '<div class="phpinfo">';

				ob_start();
				phpinfo(INFO_GENERAL + INFO_CONFIGURATION + INFO_MODULES);
				$html = ob_get_contents();
				ob_end_clean();

				// a little help from my friends at moodle :)
				$html = preg_replace('#(\n?<style[^>]*?>.*?</style[^>]*?>)|(\n?<style[^>]*?/>)#is', '', $html);
				$html = preg_replace('#(\n?<head[^>]*?>.*?</head[^>]*?>)|(\n?<head[^>]*?/>)#is', '', $html);
	echo '
		', $html;
		
	echo '</div>
			</td>
		</tr>
	</table>';
}

?>
